Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RunAllTests] Consolidate testing to ensure all tests are covered in Bazel CI #2697

Merged

Conversation

BenHenning
Copy link
Member

This PR updates our test declarations such that all tests under each module are always included. In all, this effort has introduced 17 test targets that were previously missing.

Note that this is intentionally a stop-gap solution since we're planning to move all tests over to individual targets (at which point we will need another check in place to ensure tests are being properly added). To prepare for this work, each module BUILD file now has a MIGRATED_TESTS list that will automatically filter out migrated tests from module-level test generation.

This PR includes fixes for ExceptionsControllerTest (similar to the fixes for LogWorkerUploadTest in #1904) since stack traces differ at runtime between Gradle & Bazel. Also, this PR forces all app module tests to be resource-compatible which introduces an extra genrule for each one. This does affect the build time slightly, but it's not substantially noticeable unless large numbers of tests are being built/run at one time.

Introduces top-level module tests so that all tests can be included by
default. Adds a bit of extra redundant processing for app module tests.
Also, fixes OptionsFragmentTest which wasn't previously included.

Removes unnecessary DataBinderMapperImpl per fixing #1683.

This results in all tests building, but they have not yet been confirmed
to be passing.
Entailed:
1. Removing non-test targets from match
2. Readding databinder mapper file (not sure why it can't be removed,
but not digging into it now)
3. Fix ExceptionsControllerTest so that it works correctly when run
outside of Gradle
4. Other various fixes

Altogether, 17 new tests were added to the Bazel test matrix.
@BenHenning BenHenning changed the title Consolidate testing to ensure all tests are covered in Bazel CI [RunAllTests] Consolidate testing to ensure all tests are covered in Bazel CI Feb 12, 2021
@BenHenning
Copy link
Member Author

Forcing all tests to run in this PR to illustrate the new tests being covered. I can't rely on compute_affected_targets since there seem to be some issues with it at the moment (see #2691 (comment)).

Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit change suggested. You can resolve this comment directly.

app/src/test/java/DataBinderMapperImpl.java Outdated Show resolved Hide resolved
@rt4914 rt4914 removed their assignment Feb 12, 2021
Copy link
Contributor

@fsharpasharp fsharpasharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this will be really helpful for the migration to make sure the tests don't break.

…re-covered

Conflicts:
	app/BUILD.bazel
	app/app_test.bzl
	domain/domain_test.bzl
	testing/BUILD.bazel
	testing/testing_test.bzl
	utility/BUILD.bazel
	utility/utility_test.bzl
Normalize Bazel docstrings.
@BenHenning
Copy link
Member Author

Updated the PR to include some reworking of Bazel doc comments to be more normalized/consistent.

@vinitamurthi vinitamurthi removed their assignment Feb 17, 2021
@BenHenning
Copy link
Member Author

@anandwana001 PTAL--we should try to get this in soon since it's reintroducing tests that were previously missed in Bazel builds.

Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, missed it earlier.

@BenHenning BenHenning added the PR don't merge - NEEDS UPDATE Corresponds to PRs that need to be updated with the latest develop changes before they can be merged label Feb 24, 2021
@BenHenning BenHenning removed the PR don't merge - NEEDS UPDATE Corresponds to PRs that need to be updated with the latest develop changes before they can be merged label Feb 24, 2021
@BenHenning BenHenning enabled auto-merge (squash) February 24, 2021 07:34
@BenHenning BenHenning merged commit 5139288 into develop Feb 24, 2021
@BenHenning BenHenning deleted the consolidate-testing-to-ensure-all-tests-are-covered branch February 24, 2021 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants